import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
/* 回收订单 地址 */
const url = "/back/recycle-order";
/* 回收订单数据：获取 回收订单信息 */
export const getRecycleOrderInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 回收订单数据：获取 回收订单详情信息 */
export const getRecycleOrderByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 回收订单数据：修改 订单备注 信息 */
export const putRecycleOrderAdminNoteInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-admin-note", params, "PUT");
};
/* 回收订单数据：修改接单 信息 */
export const putRecycleOrderAcceptInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/accept", params, "PUT");
};
/* 回收订单数据：确认收货 信息 */
export const putRecycleOrderReceiveInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/receive", params, "PUT");
};
/* 回收订单数据：修改出价 信息 */
export const putRecycleOrderBidInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/bid", params, "PUT");
};
/* 回收订单数据：财务转账 信息 */
export const putRecycleOrderTransferInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/transfer", params, "PUT");
};
/* 回收订单数据：解除店铺绑定 信息 */
export const putRecycleOrderRevokeInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/revoke", params, "PUT");
};
/* 回收订单数据：取消订单 信息 */
export const putRecycleOrderCancelInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/cancel", params, "PUT");
};
